package com.ycz.master.config;

import com.ycz.master.interceptor.LoginIntercetor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * author zyc
 * Created on 2021/10/6 16:37
 */
@Configuration
public class LoginConfiguration implements WebMvcConfigurer {
    @Override
    public void addInterceptors(InterceptorRegistry registry) {

        registry.addInterceptor(new LoginIntercetor())
                .addPathPatterns("/**")
                .excludePathPatterns("/","/login")
//                .excludePathPatterns("classpath:/static/**");
                .excludePathPatterns("/favicon.ico", "/bootstrap-3.3.7-dist/**", "/css/**",
                "/fonts/**", "/images/**", "/js/**", "/lib/**");
    }
}
